/* Copyright (c) 2011 Jordan Gray, MIT; see COPYRIGHT */


#ifndef INT_H_
#define INT_H_

#include <iostream>

namespace ch11ex03 {

class INT {
public:
  INT(int integer=0) : integer_(integer) {
    std::cout << "constructor, assigned " << integer << std::endl;
  }
  operator int() const {
    std::cout << "converting to int:  " << integer_ << std::endl;
    return integer_;
  }
  INT& operator++() {
    integer_ += 1;
    return *this;
  }
  INT& operator--() {
    integer_ -= 1;
    return *this;
  }
  INT operator++(int) {
    INT temp_integer = integer_;
    integer_ += 1;
    return temp_integer;
  }
  INT operator--(int) {
    INT temp_integer = integer_;
    integer_ -= 1;
    return temp_integer;
  }
  INT& operator+=(int integer) {
    integer_ += integer;
    return *this;
  }
  INT& operator-=(int integer) {
    integer_ -= integer;
    return *this;
  }
private:
  int integer_;
};

} // namespace ch11ex03


#endif /* INT_H_ */
